using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Comdiv.Application;
using Comdiv.Inversion;


namespace wikiviewer.Controllers
{
    public class WikiController : Controller
    {
        //
        // GET: /Wiki/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Show(string page){
            ViewData["pagename"] = page;
            ViewData["root"] = getRoot();
            ViewData["wikirender"] = new WikiRender(page, getRoot(),myapp.Container.all<IWikiFormatter>().ToArray());
            return View("show", "wiki");
        }

        private string getRoot(){
            return ConfigurationManager.AppSettings["pathtowiki"];
        }
    }
}
